package com.nbsaas.boot;

/**
 * OCR和AI服务配置类
 */
public class OcrConfig {
    
    // 百度OCR配置
    public static final String BAIDU_APP_ID = "11263289";
    public static final String BAIDU_API_KEY = "0IT3qnFGrbwl70CMuw9kdIj6";
    public static final String BAIDU_SECRET_KEY = "69hI44PhWj2wPj4HNu57FsYtvVFOjT7b";
    
    // 火山引擎AI配置
    public static final String VOLCENGINE_API_KEY = "abcbb0e3-8c35-4006-b7bd-7f553652f2e5";
    public static final String VOLCENGINE_MODEL = "ep-20250615181650-gmg8x";
    
    // 网络连接配置
    public static final int OCR_CONNECTION_TIMEOUT = 2000;
    public static final int OCR_SOCKET_TIMEOUT = 60000;
    
    // AI提示词配置
    public static final String AI_SYSTEM_PROMPT = 
        "你是一个把OCR识别内容转换成JSON格式的程序。请分析识别内容，返回JSON格式，格式要求：手机号(phone)、时长(duration)、时间(callTime)。时长必须为整型数字格式，以秒为单位，时间格式是HH:MM。如果某个字段无法识别，返回null。";
    
    // 正则表达式配置
    public static final String PHONE_PATTERN = "^1\\d{10}$";
    public static final String TIME_PATTERN = "^(\\d{2}:\\d{2})去电$";
    public static final String DURATION_PATTERN = "^(\\d+)秒钟$";
    
    // 智能策略配置
    public static final double CONFIDENCE_THRESHOLD = 0.8; // 置信度阈值
    public static final int MIN_WORDS_COUNT = 3; // 最少识别文字数量
    public static final boolean ENABLE_SMART_STRATEGY = true; // 启用智能策略
    public static final boolean ENABLE_COMPLETE_EXTRACTION_CHECK = true; // 启用完整提取检查
    public static final boolean ENABLE_CONFIDENCE_EVALUATION = true; // 启用置信度评估
    public static final boolean ENABLE_WORDS_COUNT_CHECK = true; // 启用文字数量检查
    
    // 置信度计算权重配置
    public static final double FIELD_EXTRACTION_WEIGHT = 0.6; // 字段提取权重
    public static final double WORDS_COUNT_WEIGHT = 0.2; // 文字数量权重
    public static final double QUALITY_BONUS_WEIGHT = 0.2; // 质量奖励权重
    
    // 质量评估配置
    public static final int EXCELLENT_WORDS_COUNT = 5; // 优秀文字数量阈值
    public static final int GOOD_WORDS_COUNT = 3; // 良好文字数量阈值
    public static final double PHONE_QUALITY_BONUS = 0.1; // 手机号质量奖励
    public static final double TIME_QUALITY_BONUS = 0.05; // 时间质量奖励
    public static final double DURATION_QUALITY_BONUS = 0.05; // 时长质量奖励
} 